{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.linear_model import LogisticRegression as LR\n",
    "from sklearn.datasets import load_breast_cancer\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "from sklearn.model_selection import cross_val_score, train_test_split\n",
    "from sklearn.feature_selection import SelectFromModel\n",
    "from sklearn.metrics import accuracy_score"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "data = load_breast_cancer()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "x = data.data\n",
    "y = data.target"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/neu/anaconda3/envs/keras-env/lib/python3.6/site-packages/sklearn/svm/_base.py:977: ConvergenceWarning: Liblinear failed to converge, increase the number of iterations.\n",
      "  \"the number of iterations.\", ConvergenceWarning)\n",
      "/home/neu/anaconda3/envs/keras-env/lib/python3.6/site-packages/sklearn/svm/_base.py:977: ConvergenceWarning: Liblinear failed to converge, increase the number of iterations.\n",
      "  \"the number of iterations.\", ConvergenceWarning)\n",
      "/home/neu/anaconda3/envs/keras-env/lib/python3.6/site-packages/sklearn/svm/_base.py:977: ConvergenceWarning: Liblinear failed to converge, increase the number of iterations.\n",
      "  \"the number of iterations.\", ConvergenceWarning)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAABIcAAAEvCAYAAADfBqG/AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nOzde5SV5X3//fd3GEZAUFBQUUQQERhGBINopEoU5CSg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uSMzd9f+xTKwp97HurZaRK4eoPO+RXUcmAGIiBuALcAPTSMazn5gMTOXWwcykG+Au+rnGUbwkGZN3+IS4EngUNuI/gOZ6TbwRumUfguco9x0Hm4d01B5UG42y5TVsVaAN1vH+Q9z2keZ7+Uk8FHd7htBXjcDH9a8TgNP1eNd57Umv7uBN8aQE2V+noW6fQw8MZK8bgHer9fgccow8K5zqnltBX4ErlxzrOu8gKcpf/BOA0eAy0aQ0zuUguQCMNtrO61z372askrZ53V/1ZrzlygjpX6u59/UOoe/mdO6bdNDThvk9QVwhvP9i0M95bVOTq/W34qTwOuURTy6zulP3y8B23vKaYO2OgKcqm11AtjZU17r5LQFOFqvwXnKyrzd5LTRNUhZHeuRvzj/f5/XOm21D/iAch9+F9g7gpwepaw8+RnwDBA95fRvtqjJSZIkSZIkaYJ8rUySJEmSJGnCLA5JkiRJkiRNmMUhSZIkSZKkCbM4JEmSJEmSNGEWhyRJkiRJkibM4pAkSZIkSdKEWRySJEmSJEmaMItDkiRJkiRJE/Y7+oGNbDNhC8QAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 1440x360 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "l2 = []\n",
    "l2test = []\n",
    "\n",
    "Xtrain, Xtest, Ytrain, Ytest = train_test_split(x,y,test_size=0.3,random_state=420)\n",
    "\n",
    "for i in np.arange(1,201,10):\n",
    "    lrl2 = LR(penalty=\"l2\",solver=\"liblinear\",C=0.9,max_iter=i)\n",
    "    lrl2 = lrl2.fit(Xtrain,Ytrain)\n",
    "    l2.append(accuracy_score(lrl2.predict(Xtrain),Ytrain))\n",
    "    l2test.append(accuracy_score(lrl2.predict(Xtest),Ytest))\n",
    "    \n",
    "graph = [l2,l2test]\n",
    "color = [\"black\",\"gray\"]\n",
    "label = [\"L2\",\"L2test\"]\n",
    "plt.figure(figsize=(20,5))\n",
    "\n",
    "for i in range(len(graph)):\n",
    "    plt.plot(np.arange(1,201,10),graph[i],color[i],label=label[i])\n",
    "plt.legend(loc=4)\n",
    "plt.xticks(np.arange(1,201,10))\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([24], dtype=int32)"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#找到最小值后停止迭代\n",
    "lr = LR(penalty=\"l2\",solver=\"liblinear\",C=0.9,max_iter=300).fit(Xtrain,Ytrain)\n",
    "lr.n_iter_"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 二元回归与多元回归"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[1347]\n",
      "training score : 0.980 (multinomial)\n",
      "[1181  437  906]\n",
      "training score : 0.953 (ovr)\n"
     ]
    }
   ],
   "source": [
    "from sklearn.datasets import load_iris\n",
    "\n",
    "iris = load_iris()\n",
    "\n",
    "for multi_class in ('multinomial', 'ovr'):\n",
    "    clf = LR(solver='sag', max_iter=1500, random_state=42,\n",
    "                             multi_class=multi_class).fit(iris.data, iris.target)\n",
    "    print(clf.n_iter_)\n",
    "    print(\"training score : %.3f (%s)\" % (clf.score(iris.data, iris.target),multi_class))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
